﻿<%@ Page Language="vb" MasterPageFile="~/Downloads.master" AutoEventWireup="false" CodeBehind="ManageDownload.aspx.vb"    Inherits="Download_Tracker_for_Yaf.ManageDownload" %>
        <asp:Content ID="Content2" ContentPlaceHolderID="contentplaceholder1" Runat="Server">
        
      <head >
<title>Downloads</title>

    <script language="javascript" type="text/javascript">
        var size = 2;
        var id = 0;

        function ProgressBar() {
            if (document.getElementById('<%=Fileupload1.ClientID %>').value != "") {
                document.getElementById("divProgress").style.display = "block";

                id = setInterval("progress()", 20);
                return true;
            }
            else
                alert("Select a file to upload");
            return false;
        }



        function progress() {
            size = size + 1;
            if (size > 299) {
                clearTimeout(id);
            }
            document.getElementById("divProgress").style.width = size + "pt";
            document.getElementById("<%=lblPercentage.ClientID %>").firstChild.data = parseInt(size / 3) + "%";
        }

    </script>
</head>

    <div class="DLWrapper">
      
        <table class="DownloadList">
            <tr>
                <td class="ListHeaderLeft">
                </td>
                <td class="ListHeaderRight">
                </td>
            </tr>
            <tr>
                <td colspan="2" class="ListHeader2">
                </td>
            </tr>
            <div id="deletediv" runat="server" visible="false">
            <tr>
            <td class="ListItem" colspan="2">
               Warning! this will delete the download <%Getfile(Request.Params("FileID"))%> .  This cannot be undone!     <asp:Button ID="Button1" runat="server" Text="Delete" /></td>
            </tr>
            </div>
            <div id="ViewDownloads" runat="server" visible="false">
                <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource2" OnItemDataBound="Repeater1_ItemDataBound">
                    <ItemTemplate>
                        <tr>
                            <td class="ListItem">
                                <img style="padding-right: 15px;" src="<%#DataBinder.Eval(Container.DataItem, "Avatar") %>" /><%#DataBinder.Eval(Container.DataItem, "DisplayName")%><br />
                                <div id="UserIP" runat="server" visible="false">
                                    Ip:
                                    <%#DataBinder.Eval(Container.DataItem, "IP")%></div>
                            </td>
                            <td class="ListItem">
                                Total Downloads:
                                <%#DataBinder.Eval(Container.DataItem, "Totaldownloads")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                   <FooterTemplate>
                    <tr>
                        <td solspan="3">
                            <asp:Label ID="StatusLabel" runat="server" Text="" Visible="false"></asp:Label>
                        </td>
                    </tr></FooterTemplate>
                </asp:Repeater>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:yafnet %>"
                    SelectCommand=""></asp:SqlDataSource>
            </div>
            <div id="UploadFile" runat="server" visible="false">
                <tr>
                    <td class="ListItem">
                        Download Title
                    </td>
                    <td class="Uploadlist">
                        <asp:TextBox ID="TextBox1" runat="server" Height="25px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        Details
                    </td>
                    <td class="Uploadlist">
                        <asp:TextBox ID="TextBox3" runat="server" Height="25px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        Download Image
                    </td>
                    <td class="Uploadlist">
                        <asp:TextBox ID="TextBox4" runat="server" Height="25px"></asp:TextBox>
                        <br />
                        *ex Image1.jpg&nbsp;&nbsp;&nbsp; you must manually upload the file to ~/images/
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        File Version
                    </td>
                    <td class="Uploadlist">
                        <asp:TextBox ID="TextBox2" runat="server" Height="25px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        Operating System
                    </td>
                    <td class="Uploadlist">
                        <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="OsDatasource" DataTextField="Name"
                            DataValueField="OS" Height="25px">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="OsDatasource" runat="server" ConnectionString="<%$ ConnectionStrings:yafnet %>"
                            SelectCommand="SELECT [OS], [Name] FROM [OperatingSystems] ORDER BY [Name]">
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        Support Forum
                    </td>
                    <td class="Uploadlist">
                        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource1"
                            DataTextField="Name" DataValueField="ForumID" Height="25px">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:yafnet %>"
                            SelectCommand="SELECT [ForumID], [Name] FROM [yaf_Forum] ORDER BY [Name]"></asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td class="ListItem">
                        File
                    </td>
                    <td class="Uploadlist">
                        <div>
                            <asp:FileUpload ID="FileUpload1" runat="server" Height="23px" /></div>
                    </td>
                </tr>
                <tr>
                    <td class="listitem">
                        Permissions
                    </td>
                    <td class="Uploadlist">
                        <asp:CheckBoxList ID="CheckBoxList1" runat="server">
                        </asp:CheckBoxList>
                        <br />
                        *Administrators / Moderators will always have access!
                    </td>
                </tr>
            </div>
            <tr>
                <td colspan="2" class="ListFooter">
                    <div id="divProgress" class="UpProgress" runat="server">
                        <asp:Label ID="lblPercentage" runat="server" Text="0%"></asp:Label>
                    </div>
                    <div class="UpStatus">
                        <asp:Label ID="Label1" runat="server" Text=""></asp:Label></div>
                    <div class="AddDownload">
                        <asp:Button CssClass="AddDownload" ID="AddDownload" runat="server" Visible="false"
                            Text="Finish" OnClientClick="return ProgressBar()" OnClick="btnAddImage_Click" /></div>
                </td>
            </tr>
        </table>
       
    </div>




  </asp:Content>